<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
	xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout">
<head th:include="inc/home::header">
</head>
<link type="text/css" th:href="@{/css/login.css}" rel="stylesheet" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="context-path" th:content="@{/}" />
<body>

	<!--内容区-->
	<div class="login-content">
	   <div class="login-a">
	   	  <div class="login-aa">系统锁定,请联系管理员</div>
		  		<form id="adminForm"       method="post" >
		  		
		  				<input type="text" readonly="readonly" style="display: none"
					name="lockName" th:value="${loginInfo}" />
	   	  <div class="login-ab">
	   	  	<ul>
	   	  		<li>
	   	  			<div class="login-user"></div>
	   	  			<input type="text"  name="userName" class="input-text" placeholder="请输入管理员用户名" />
	   	  		</li>
	   	  		<li>
	   	  			<div class="login-password"></div>
	   	  			<input type="password" name="userPassword" class="input-text" placeholder="请输入密码" />
	   	  		</li>
	   	  		<li><input type="button"  id="unlock" value="解 锁" class="submit-text"  /></li>
	   	  	</ul>
	   	  </div>
		   </form>
		
	   </div>
	</div>



	
	
	
	
</body>
<script th:inline="javascript">  
/*<![CDATA[*/ 
$(function() {
		$('#unlock').on('click', function(e) {
			   var data= getDataJson("adminForm");
       		   var obj = JSON.stringify(data);
   		       AjaxWebTableInfo("/admin/unlock",data);
	
			});
	
});	  

function AjaxWebTableInfo(url , obj){
	 $.ajax({
	     type: "post",
	     dataType: "json",
	     url: url,
	     data:obj,
	     success: function (data, status) {
	    	 if(data=="1"){
	    		 $.Zebra_Dialog('<div class="prompt"><div class="success-icon"></div><div class="success-title">解锁成功!</div></div>', {
			            'title':'提示',
			            'show_close_button':false,
			            'overlay_close':false,
			            'buttons':[    {caption: '确定', callback: function() { 
			            	window.location.href="/"
			             }}]
			         });
	    	 }else  if(data=="2"){		
	    		 $.Zebra_Dialog('<div class="prompt"><div class="success-icon"></div><div class="success-title">不是系统管理员!</div></div>', {
		            'title':'提示',
		            'show_close_button':false,
		            'buttons':[    {caption: '确定', callback: function() { 
		             }}]
		         });
	    		 
	    	 }else  if(data=="3"){		
	    		 $.Zebra_Dialog('<div class="prompt"><div class="success-icon"></div><div class="success-title">不存在此用户!</div></div>', {
			            'title':'提示',
			            'show_close_button':false,
			            'buttons':[    {caption: '确定', callback: function() { 
			             }}]
			         });
		    		 
		    	 }else  if(data=="4"){		
		    		 $.Zebra_Dialog('<div class="prompt"><div class="success-icon"></div><div class="success-title">用户名或密码不对!</div></div>', {
				            'title':'提示',
				            'show_close_button':false,
				            'buttons':[    {caption: '确定', callback: function() { 
				             }}]
				         });
			    		 
			    	 }else  if(data=="5"){		
			    		  $.Zebra_Dialog('<div class="prompt"><div class="success-icon"></div><div class="success-title">次数已经超过三次!</div></div>', {
					            'title':'提示',
					            'show_close_button':false,
					            'buttons':[{caption: '确定', callback: function() { 
					            	window.location.href="/activate"
					             }}]
					         });
				    	 }else {
	    			
	    	 }
	    
	     },
	     error: function (data) {
	    	 
	     }
	 });	
}
/*]]>*/ 
</script>
</html>
